import {
  mysqlTable,
  varchar,
  tinyint,
  bigint,
  index,
  datetime,
} from "drizzle-orm/mysql-core";
import { desc, sql } from "drizzle-orm";

const createdAt = datetime({ fsp: 0, mode: "string" }).default(
  sql`CURRENT_TIMESTAMP`,
);

const timestamps = {
  createdAt: createdAt,
  updatedAt: datetime({ fsp: 0, mode: "string" })
    .default(sql`CURRENT_TIMESTAMP`)
    .$onUpdate(() => new Date() as any),
};

const ID = bigint("id", { mode: "number", unsigned: true })
  .primaryKey()
  .autoincrement();
